books %>%mutate(Author =as.factor(Author), Title =as.factor(Title), `Type of Ban`=as.factor(`Type of Ban`), State =as.factor(State), District =as.factor(District), `Date of Challenge/Removal`=as.factor(`Date of Challenge/Removal`), `Origin of Challenge`=as.factor(`Origin of Challenge`)) %>%select(Author, Title, `Type of Ban`, State, `Date of Challenge/Removal`, `Origin of Challenge`) %>%datatable(filter="top", options =list(pageLength =5, autoWidth =TRUE), rownames=FALSE)
Top 7 Most Banned Books
Show the code
#Add links to purchase the books -> to authors homepage? topbooks %>%select(image = image_url, Title, Author, numTimesBanned) %>%ungroup() %>%gt()%>%gt_img_rows(columns = image,img_source="local", height =150)%>%tab_header(title ="The Most Banned Books from July 2021 - June 2022") %>%cols_label(Title ="Book Title",image ="Book Cover",Author ="Author",numTimesBanned ="Total Number of Bans" )
The Most Banned Books from July 2021 - June 2022
Book Cover
Book Title
Author
Total Number of Bans
Gender Queer: A Memoir
Kobabe, Maia
41
All Boys Aren't Blue
Johnson, George M.
29
Out of Darkness
Pérez, Ashley Hope
23
The Bluest Eye
Morrison, Toni
22
Lawn Boy
Evison, Jonathan
17
The Hate U Give
Thomas, Angie
17
The Absolutely True Diary of a Part-Time Indian
Alexie, Sherman
16
References
Iannone, Richard, Joe Cheng, Barret Schloerke, Ellis Hughes, and JooYoung Seo. 2022. Gt: Easily Create Presentation-Ready Display Tables. https://CRAN.R-project.org/package=gt.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.”Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.
Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani, and Dewey Dunnington. 2022. Ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics. https://CRAN.R-project.org/package=ggplot2.